/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #3498db;
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2rem;
}

/* 文章列表样式 */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.article-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.article-excerpt {
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #888;
}

.article-date, .article-category {
    background-color: #f1f2f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* 文章详情页样式 */
.back-button {
    background: none;
    border: none;
    color: #3498db;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #3498db;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #3498db;
    color: white;
}

.article-detail {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.article-detail-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.detail-meta {
    margin-bottom: 2rem;
}

.article-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-detail-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.article-detail-content p {
    margin-bottom: 1rem;
}

/* 关于页面样式 */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.about-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* 联系表单样式 */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.submit-button {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #2980b9;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .articles-container {
        grid-template-columns: 1fr;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        width: 150px;
        height: 150px;
    }

    .article-detail {
        padding: 1rem;
    }

    .article-detail-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        flex-direction: column;
        text-align: center;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .contact-form {
        padding: 1rem;
    }
}